<?php
date_default_timezone_set("PRC");
$api = 'http://d.apiplus.net/newly.do?token=t221131de68eb5f44k&code=bjpk10&format=json';
$resource = file_get_contents( $api );  


$data = json_decode( $resource , 1 );
$data = $data['data'];

//print_r($data) ;
$ct = $data[0]['expect'];

$cd = $data[0]['opencode'];

$cr = $data[0]['opentime'];

//exit;
header('Content-Type: text/xml;charset=utf8');
$limit=strlen($ct)-2;

$ct=substr($ct,0,$limit).''.substr($ct,$limit,$limit+2);

$time = date('Y-m-d H:i',$data[0]['opentimestamp']).":00";
echo '<xml>
<row expect="'.$ct.'" opencode="'.$cd.'" opentime="'.str_replace('/','-',$time).'"/>
</xml>';